<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>File Source for svg.php</title>
	<link rel="stylesheet" type="text/css" href="../media/style.css">
	<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
	<script src="media/a.js"></script>
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
	<td class="header-top-left"><img src="../media/logo.png" border="0" alt="phpDocumentor " /></td>
    <td class="header-top-right">Examples<br /><div class="header-top-right-subpackage"></div></td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td colspan="2" class="header-menu">
      
                                      
                                    		[ <a href="../classtrees_Examples.html" class="menu">class tree: Examples</a> ]
		[ <a href="../elementindex_Examples.html" class="menu">index: Examples</a> ]
            [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td colspan="2" class="header-line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="195" class="menu">
		<div class="package-title">Examples</div>
  <div class="package">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
	</div>
      <b>Packages:</b><br />
  <div class="package">
              <a href="../li_QueryPath.html">QueryPath</a><br />
              <a href="../li_Examples.html">Examples</a><br />
              <a href="../li_Tests.html">Tests</a><br />
      	</div>
      <br />
                        <br />
                      </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file svg.php</h1>
<p>Documentation is available at <a href="../Examples/_examples---svg.php.html">svg.php</a></p>
<div class="src-code"><span class="php">
<ol><li><div class="src-line"><a name="a1"></a><span class="src-php">&lt;?php</span></div></li>
<li><div class="src-line"><a name="a2"></a><span class="src-doc">/**</span></div></li>
<li><div class="src-line"><a name="a3"></a><span class="src-doc">&nbsp;*&nbsp;Using&nbsp;QueryPath&nbsp;to&nbsp;Generate&nbsp;a&nbsp;Scalable&nbsp;Vector&nbsp;Graphic&nbsp;(SVG).</span></div></li>
<li><div class="src-line"><a name="a4"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a5"></a><span class="src-doc">&nbsp;*&nbsp;This&nbsp;file&nbsp;contains&nbsp;an&nbsp;example&nbsp;of&nbsp;how&nbsp;QueryPath&nbsp;can&nbsp;be&nbsp;used</span></div></li>
<li><div class="src-line"><a name="a6"></a><span class="src-doc">&nbsp;*&nbsp;to&nbsp;generate&nbsp;an&nbsp;SVG&nbsp;image.&nbsp;SVG&nbsp;(Scalable&nbsp;Vector&nbsp;Graphics)&nbsp;is&nbsp;a&nbsp;W3C&nbsp;standard</span></div></li>
<li><div class="src-line"><a name="a7"></a><span class="src-doc">&nbsp;*&nbsp;XML&nbsp;format&nbsp;for&nbsp;creating&nbsp;graphics.&nbsp;You&nbsp;can&nbsp;find&nbsp;out&nbsp;more&nbsp;about&nbsp;it</span></div></li>
<li><div class="src-line"><a name="a8"></a><span class="src-doc">&nbsp;*&nbsp;here:&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;http://www.w3.org/TR/SVG11/}</span><span class="src-doc">.</span></div></li>
<li><div class="src-line"><a name="a9"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a10"></a><span class="src-doc">&nbsp;*&nbsp;If&nbsp;you&nbsp;would&nbsp;like&nbsp;to&nbsp;view&nbsp;the&nbsp;SVG&nbsp;file&nbsp;that&nbsp;is&nbsp;created,&nbsp;the&nbsp;file&nbsp;is&nbsp;available</span></div></li>
<li><div class="src-line"><a name="a11"></a><span class="src-doc">&nbsp;*&nbsp;at&nbsp;</span><span class="src-doc-inlinetag">{@link&nbsp;http://querypath.org/svg.php}</span><span class="src-doc">.&nbsp;(That&nbsp;URL&nbsp;actually&nbsp;runs&nbsp;the&nbsp;script&nbsp;displayed</span></div></li>
<li><div class="src-line"><a name="a12"></a><span class="src-doc">&nbsp;*&nbsp;here.)</span></div></li>
<li><div class="src-line"><a name="a13"></a><span class="src-doc">&nbsp;*</span></div></li>
<li><div class="src-line"><a name="a14"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@package</span><span class="src-doc">&nbsp;Examples</span></div></li>
<li><div class="src-line"><a name="a15"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@author</span><span class="src-doc">&nbsp;M&nbsp;Butcher&nbsp;&lt;matt@aleph-null.tv&gt;</span></div></li>
<li><div class="src-line"><a name="a16"></a><span class="src-doc">&nbsp;*&nbsp;</span><span class="src-doc-coretag">@license</span><span class="src-doc">&nbsp;LGPL&nbsp;The&nbsp;GNU&nbsp;Lesser&nbsp;GPL&nbsp;(LGPL)&nbsp;or&nbsp;an&nbsp;MIT-like&nbsp;license.</span></div></li>
<li><div class="src-line"><a name="a17"></a><span class="src-doc">&nbsp;*/</span></div></li>
<li><div class="src-line"><a name="a18"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a19"></a><span class="src-inc">require_once&nbsp;</span><span class="src-str">'../src/QueryPath/QueryPath.php'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a20"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a21"></a><span class="src-comm">//&nbsp;Let's&nbsp;stub&nbsp;out&nbsp;a&nbsp;basic&nbsp;SVG&nbsp;document.</span></div></li>
<li><div class="src-line"><a name="a22"></a><span class="src-var">$svg_stub&nbsp;</span>=&nbsp;<span class="src-str">'&lt;?xml&nbsp;version=&quot;1.0&quot;?&gt;</span></div></li>
<li><div class="src-line"><a name="a23"></a><span class="src-str">&lt;svg</span></div></li>
<li><div class="src-line"><a name="a24"></a><span class="src-str">&nbsp;&nbsp;&nbsp;xmlns:svg=&quot;http://www.w3.org/2000/svg&quot;</span></div></li>
<li><div class="src-line"><a name="a25"></a><span class="src-str">&nbsp;&nbsp;&nbsp;xmlns=&quot;http://www.w3.org/2000/svg&quot;</span></div></li>
<li><div class="src-line"><a name="a26"></a><span class="src-str">&nbsp;&nbsp;&nbsp;xmlns:xlink=&quot;http://www.w3.org/1999/xlink&quot;</span></div></li>
<li><div class="src-line"><a name="a27"></a><span class="src-str">&nbsp;&nbsp;&nbsp;version=&quot;1.0&quot;</span></div></li>
<li><div class="src-line"><a name="a28"></a><span class="src-str">&nbsp;&nbsp;&nbsp;width=&quot;800&quot;</span></div></li>
<li><div class="src-line"><a name="a29"></a><span class="src-str">&nbsp;&nbsp;&nbsp;height=&quot;600&quot;</span></div></li>
<li><div class="src-line"><a name="a30"></a><span class="src-str">&nbsp;&nbsp;&nbsp;id=&quot;test&quot;&gt;</span></div></li>
<li><div class="src-line"><a name="a31"></a><span class="src-str">&nbsp;&nbsp;&lt;desc&gt;Created&nbsp;by&nbsp;QueryPath.&lt;/desc&gt;</span></div></li>
<li><div class="src-line"><a name="a32"></a><span class="src-str">&lt;/svg&gt;'</span><span class="src-sym">;</span></div></li>
<li><div class="src-line"><a name="a33"></a>&nbsp;</div></li>
<li><div class="src-line"><a name="a34"></a><a href="../QueryPath/_src---QueryPath---QueryPath.php.html#functionqp">qp</a><span class="src-sym">(</span><span class="src-var">$svg_stub</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a35"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">attr</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'width'&nbsp;</span>=&gt;&nbsp;<span class="src-num">800</span><span class="src-sym">,&nbsp;</span><span class="src-str">'height'&nbsp;</span>=&gt;&nbsp;<span class="src-num">600</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a36"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">append</span><span class="src-sym">(</span><span class="src-str">'&lt;rect&nbsp;id=&quot;first&quot;/&gt;&lt;rect&nbsp;id=&quot;second&quot;/&gt;'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a37"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">find</span><span class="src-sym">(</span><span class="src-str">'#second'</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a38"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">attr</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'x'&nbsp;</span>=&gt;&nbsp;<span class="src-num">15</span><span class="src-sym">,&nbsp;</span><span class="src-str">'y'&nbsp;</span>=&gt;&nbsp;<span class="src-num">4</span><span class="src-sym">,&nbsp;</span><span class="src-str">'width'&nbsp;</span>=&gt;&nbsp;<span class="src-num">40</span><span class="src-sym">,&nbsp;</span><span class="src-str">'height'&nbsp;</span>=&gt;&nbsp;<span class="src-num">60</span><span class="src-sym">,&nbsp;</span><span class="src-str">'fill'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'red'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a39"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><a href="http://www.php.net/prev">prev</a><span class="src-sym">(</span><span class="src-sym">)</span></div></li>
<li><div class="src-line"><a name="a40"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">attr</span><span class="src-sym">(</span><span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'x'&nbsp;</span>=&gt;&nbsp;<span class="src-num">2</span><span class="src-sym">,&nbsp;</span><span class="src-str">'y'&nbsp;</span>=&gt;&nbsp;<span class="src-num">2</span><span class="src-sym">,&nbsp;</span><span class="src-str">'width'&nbsp;</span>=&gt;&nbsp;<span class="src-num">40</span><span class="src-sym">,&nbsp;</span><span class="src-str">'height'&nbsp;</span>=&gt;&nbsp;<span class="src-num">60</span><span class="src-sym">,&nbsp;</span><span class="src-str">'fill'&nbsp;</span>=&gt;&nbsp;<span class="src-str">'navy'</span><span class="src-sym">))</span></div></li>
<li><div class="src-line"><a name="a41"></a>&nbsp;&nbsp;<span class="src-sym">-&gt;</span><span class="src-id">writeXML</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></div></li>
</ol>
</span></div>
        <div class="credit">
		    <hr class="separator" />
		    Documentation generated on Thu, 19 Mar 2009 18:01:28 -0500 by <a href="http://www.phpdoc.org">phpDocumentor 1.4.2</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>